package com.example.spring_rabbit.constum;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author wangc
 * @date 2022/8/26 10:06
 */
@Component
//  队列名称  是否持久化 消费后是否立即删除
@RabbitListener(queuesToDeclare = @Queue(value = "helloWord",durable = "true",autoDelete = "true"))
public class constum {
    @RabbitHandler
    public void rece(String message) {
        System.out.println("得到的消息"+message);

    }

}
